//
//  Common.h
//  LehuiCity
//
//  
//

#ifndef LehuiCity_Common_h
#define LehuiCity_Common_h

#define PERSONALIMFORMATIONPATH [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]

#pragma mark -正式与测试环境

//正式
//#define HOSTURL @"http://apichild.our100.net/Server/default.aspx"
//#define PICPERFIXURL @"http://file.our100.net/images.aspx?fileid="
//#define REQUESTIMAGEURL @"http://file.our100.net"
//#define JAVAHOSTURL @"http://api.safe.our100.net/hs_api/"

////测试
#define HOSTURL @"http://api.e-shiyun.com/Server/default.aspx"
#define PICPERFIXURL @"http://file.e-shiyun.com/images.aspx?fileid="
#define REQUESTIMAGEURL @"http://file.e-shiyun.com"
#define JAVAHOSTURL @"http://hsapi.im.e-shiyun.com/hs_api/"

#define VERSIONCODE @"师云平安幼儿 V1.3.0"

#define KOALACAMHOSTURL @"https://v2.koalacam.net"

#define KNOTIFICATION_LOGINCHANGE @"loginStateChange"

#define IMAGEHOSTURL [NSString stringWithFormat:@"%@/images.aspx?fileid=",REQUESTIMAGEURL]

#define SUBMITIMAGEURL [NSString stringWithFormat:@"%@/imgdb.asmx",REQUESTIMAGEURL]
#define SOAPSTRING(action) [NSString stringWithFormat:@"%@/imgdb/%@",REQUESTIMAGEURL,action]

#define ISLOGIN [[NSUserDefaults standardUserDefaults] objectForKey:@"isLogin"]
#define APP_PASS            @"W#%45234QSK#%$!F#%4" 
#define SHIYUN_APP_PASS     @"E#%600B1FD5#%79F#%4"
#define USERID [[NSUserDefaults standardUserDefaults] objectForKey:@"userid"]
#define SCHOOLID [SYAccountTool ShareAccount].account.scid
#define CONSTAPPDELEGATE (AppDelegate *)[[UIApplication sharedApplication] delegate]
#define IS_iOS7 ((floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1))
#define iOS7_or_Later ([[UIDevice currentDevice] systemVersion].floatValue >= 7.0 ? YES : NO)
#define IS_iPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#define IS_IPHONE4 (([[UIScreen mainScreen] bounds].size.height-480)?NO:YES)
#define IS_IPHONE5 (([[UIScreen mainScreen] bounds].size.height-568)?NO:YES)


typedef NS_ENUM(NSInteger, ManageType) {
    ManageTypeStudent = 0,
    ManageTypeTeacher = 1,
    ManageTypeParent = 2,
};

#define BTNCOLOR [UIColor colorWithRed:122.0f/255.0f green:126.0f/255.0f blue:220.0f/255.0f alpha:1.0f]
#define RGBCOLOR(r, g, b)   [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]

#define RGBACOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)]


#define KPHONELABELDICDEFINE	@"KPhoneLabelDicDefine"
#define KPHONENUMBERDICDEFINE	@"KPhoneNumberDicDefine"
#define KPHONENAMEDICDEFINE	    @"KPhoneNameDicDefine"


#define SCREENWIDTH  ([UIScreen mainScreen].bounds.size.width)
#define SCREENHEIGH  ([UIScreen mainScreen].bounds.size.height)

#define SafeAreaBottomHeight (SCREENHEIGH == 812.0 ? 34 : 0)
#define SafeAreaTopHeight (SCREENHEIGH == 812.0 ? 88 : 64)

#define VIEW_WIDTH self.view.frame.size.width
#define VIEW_HEIGHT self.view.frame.size.height

#define KeyWindow [UIApplication sharedApplication].keyWindow;
#define ImageWidht  800

//适配
#define XZHEIGHT(h) (h) * SCREENWIDTH /320


#define LIGHT_GREEN [UIColor colorWithRed:228.0f/255.0f green:237.0f/255.0f blue:220.0f/255.0f alpha:1.0f]
#define LINE_GREEN  [UIColor colorWithRed:141.0f/255.0f green:194.0f/255.0f blue:31.0f/255.0f alpha:1.0f]

#define TAG_ALERT_LOGIN     999
#define TAG_ALERT_UPDATE    998

#define kAppId  [[NSBundle mainBundle] objectForInfoDictionaryKey:@"appId"]//应用在苹果商店的id
#define kiTunesAdd @"http://https://itunes.apple.com/cn/app//idAPP_ID?mt=8"
#define kiTunesRequest @"http://itunes.apple.com/lookup?id=APP_ID"
#define WEIBO_URL [[NSBundle mainBundle] objectForInfoDictionaryKey:@"weibo"]

#define NSNOTIFICATION_PAY_SUC  @"NSNOTIFICATION_PAY_SUC"

#define APP_SCHEME  (NSString*)[[[[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleURLTypes"] objectAtIndex:0] objectForKey:@"CFBundleURLSchemes"] objectAtIndex:0]


#define USR_DECEVIEC      @"user_pfiles"
#define USER_PROFILE        @"user_pfile"
#define PHONE_NUMBER        @"031185108080"

#define KEY_CKIENTID     @"clienttype"
#define USERTYPE    @"0"
#define KEY_USERTYPE     @"usertype"
#define KEY_METHOD          @"Method"
#define KEY_TIMESTAMP       @"timestamp"
#define KEY_TRANSACTIONID   @"transactionId"
#define KEY_APPID           @"appID"
#define KEY_ASYNCMODE       @"asyncMode"
#define KEY_SIGNMETHOD      @"signMethod"
#define KEY_INPUTCHARSET    @"inputcharset"
#define KEY_SIGN            @"sign"
#define KEY_GROUPID         @"groupid"
#define KEY_MARKETID        @"marketId"
#define KEY_CATEID          @"cateid"
#define KEY_PAGENO          @"PageNo"
#define KEY_PAGESIZE        @"PageSize"
#define KEY_CATEGORYID      @"category"
#define KEY_POSITIONID      @"positionid"
#define KEY_HAVECOUPON      @"HaveCoupon"
#define KEY_STOREID         @"storeID"
#define KEY_USERID          @"UserID"
#define KEY_ACTIVITYID   @"ActivityID"
#define KEY_CONTENT         @"content"
#define KEY_NEWPASS         @"newPass"
#define KEY_OLDPASS         @"oldPass"
#define KEY_COUPONID        @"couponID"
#define KEY_MOBILE          @"Mobile"
#define KEY_USERPASS        @"userPass"
#define KEY_BIRTHDAY        @"Birthday"
#define KEY_DAYMODE         @"DayMode"
#define KEY_GENDER          @"Gender"
#define KEY_USERNAME        @"UserName"
#define KEY_LOGINPASS       @"LoginPass"
#define KEY_VERIFYCODE      @"verifyCode"
#define KEY_TYPE            @"Type"
#define KEY_MARKETLEVELID   @"MarketLevelID"
#define KEY_ORDERID         @"OrderID"
#define KEY_DEVICETOKEN     @"channelid"
#define KEY_KEY           @"Key"
#define KEY_ISATTENTION @"isAttention"


#define VALUE_APPID         @"mobile"
#define VALUE_ASYNCMODE     @"false"
#define VALUE_SIGNMETHOD    @"MD5"
#define VALUE_INPUTCHARSET  @"utf-8"
#define VALUE_GROUPID     @"1"  //[[NSBundle mainBundle] objectForInfoDictionaryKey:@"groupId"]//@"2"
#define VALUE_MARKETID      @"1"  // [[NSBundle mainBundle] objectForInfoDictionaryKey:@"marketid"]//@"2"
#define VALUE_CATEID        [[NSBundle mainBundle] objectForInfoDictionaryKey:@"cateId"]//@"5"
#define VALUE_PAGESIZE      @"15"
#define VALUE_HAVECOUPON    @"2"

//***********************************  接口地址  *************************************


//********************************************************************************


#define RESPONSE_RE_CODE            @"re_code"
#define RESPONSE_RE_DATA            @"re_data"
#define RESPONSE_DATA               @"data"
#define RESPONSE_DATAPIC            @"datapic"
#define RESPONSE_RE_INFO            @"re_info"
#define RESPONSE_RE_INFOCOUNT       @"re_infocount"
#define RESPONSE_MEMBERINFO         @"memberinfo"
#define RESPONSE_MARKETMEMBER       @"marketmember"
#define RESPONSE_OLDPASS  @"oldpass"
#define RESPONSE_NEWPASS  @"newpass"

//*********Add by zz(16.05.03) [增加了用于记录最后一次登录身份的type宏定义] **********
#define XZLASTTYPE @"lasttype"
//****************End****************

//*********Add by zz(16.05.06) [增加了用于记录会话列表扩展消息的宏定义] **********
#define EXTLOGO @"logo"
#define EXTNAME @"username"
#define EXTLOGOTYPE @"logo_type"
#define EXTPHONENUM @"phone_number"
//****************End****************

//*********Add by zz(16.05.09) [增加了群组昵称的宏定义] **********
#define GROUPNICINAME(s,u) [NSString stringWithFormat:@"%@%@%@",@"groupnickname",s,u];
//****************End****************


//用户头像
#define XZHEADURL @"XZheadUrl"

//分享相关
#define QQAPPID @"1105704647"
#define QQAPPSECRECT @"l70X6XZ32fOInRbS"

#define WECHATAPPID @"wxfa01b0c9baac67a5"
#define WECHATSECRECT @"e116b996063ef5db04fb15bd3faed380"

#define NORECEIVE @"noceive"

#define LINECOLOR RGBCOLOR(199, 199, 204)
#define TABLEHEADERBGCOLOR RGBCOLOR(240,239,245)
#define DEFAULTCOLOR colorFromHex(@"#1098f7")

#define SYHaveClass @"syhaveclass"
#define SYHaveStudent @"syhaveStudent"
#define SYIsAdviser @"isadviser"//是否有班主任身份

#define SYStudentName @"syStudentName"
#define SYISFirstLogin @"syisfirstLogin"

#define SYTypeNewFunc @"sytypeNewFunc"

#define kSDKUsername   @"username"




#endif

